<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=\, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>提币</title>
  <link rel="stylesheet" href="__CSS__/ming_common.css">
  <link rel="stylesheet" href="__CSS__/ming.css">
  <script src="__JS__/ios-web-app.js"></script>
</head>

<body style="padding-top: 38px">
  <header class="header" style="display: flex;justify-content: space-between">
    <a href='{:U("Index/index")}'><img src="__IMG__/hd/backr.png" style="width: .3rem"
        alt=""></a>
    <p style="padding-left:.2rem;">24小时服务</p>
    <span>hbk.vip@outlook.com</span>
  </header>
  <section style=" background: #fff;padding-top:.2rem">

     <div>
         <div class="recharge_b">
             <h1>充币</h1>
             <img src="__IMG__/hd/messager.png" alt="">
         </div>
         <div>
             <p style="padding:.2rem;color:#A9A9A9;">币种:USDT_ERC20</p>
         </div>
     </div>

    <div >

        <section class="wechat_box">
            <div class="send_box">
                <img src="__IMG__/hd/vuser.png" class="headuser" alt="">
                <div>请您提供一下充币地址请您提供一下充币地址请您提供一下充币地址请您提供一下充币地址请您提供一下充币地址请您提供一下充币地址</div>
            </div>

            <div class="reply_box">
                <div>请您提供一下充币地址请您提供一下充币地址请您提供一下充币地址请您提供一下充币地址请您提供一下充币地址</div>
                <img src="__IMG__/hd/userc.png"  class="headuser" alt="">

            </div>

        </section>


      <section class="prompt" style="">
        <ul>
            <li>请勿充值任何ERC20_USDT资产,否则资产无法找回</li>
            <li>请您充值后,需要整个网络节点的确定,12次网络确认后到账,12次网络确认后可提币</li>
            <li>最小充值金额,1USDT,小于最小金额的充值将不会上账且无法退回</li>
            <li>请务必确认电脑及浏览器安全,防止信息被改或泄露</li>
        </ul>
      </section>


    </div>

      <div class="footer_input">
          <div class="input_box">
              <input type="text" placeholder="在此输入你的对话..." id="send_input">
              <img src="__IMG__/hd/picr.png" alt="" style="width: .5rem">
          </div>

          <div>
              <button id="send_btn">发送</button>
          </div>
      </div>
  </section>
    <style>
        html{
            background: #F1F3f4;
        }
        .footer_input button{
            color: #fff;
            border-radius: 6px;
            padding: .2rem .3rem;
            margin-left: .2rem;
            background: #A9A9A9;
        }
        .footer_input{
            position: fixed;
            bottom: 0;
            height:.7rem;
            background: #fff;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            padding: .2rem;
        }
        .footer_input .input_box{
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #F1F3F4;
            padding: .2rem;
            width: 70%;
        }
        .footer_input .input_box input{
            background: #F1F3F4;
        }
        .recharge_b{
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 .2rem;
            background: #fff;
        }
        ul li{
            list-style: inside;
            padding: .1rem  .2rem;
            color: #a9a9a9;
        }
        .recharge_b h1{
            font-size:.5rem;
        }
        .recharge_b img{
            width: .5rem;
        }
        .wechat_box{
            border-top: 5px solid #F1F3F4;
            padding: .2rem;
            background: #fff;
            height: 3rem;
            overflow-y: auto;
        }
        .wechat_box .headuser{
            width: .6rem;
            padding: .1rem;
        }
        .send_box,.reply_box{
            display: flex;
            align-items:flex-start;
            margin: .1rem 0;
        }
        .send_box>div,.reply_box>div{
            padding-top: .24rem;
        }
        .send_box>div{
            padding-right: .7rem;
        }
        .reply_box>div{
            padding-left: .7rem;
        }
        .send_box{
            justify-content: flex-start;
        }
        .reply_box{
            justify-content: flex-end;
        }
      .zhuanzhang_choose select{
        width: 100%;
        font-size: .3rem;
      }
      .zhuanzhang_input input{
        border-bottom: none;
        width: 60%;
      }

      input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
        color: #a9a9a9;
      }
        .header{
            justify-content: left;
        }
    </style>

    <!--<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>-->
  <!-- 引入js -->
  <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
  <script type="text/javascript" src="/Public/Home/js/web3.1.js"></script>
    <script type="text/javascript">
        $(".all_btn").click(function () {
            let balance=$('#balance').val();
            $("#amount").val(balance);
        });

        $(function() {
            $("#send_input").bind('input propertychange', function() {
                if($("#send_input").val() !=''){
                    $('#send_btn').css('background','#ED1C24')
                }else{
                    $('#send_btn').css('background','#A9A9A9')
                }
            })
        })

      let val1=$("#ptr73").val();
      $("#charge").text(parseFloat(val1)*100);
        $('#coinname').change(function(){

            // console.log(11223344);return false;
            //生成BTC地址
            var coinname = $("#coinname").val();

            if (coinname==='1'){
              let val1=$("#ptr73").val();
              $("#charge").text(parseFloat(val1)*100);
            } else if (coinname==='2'){
              let val2=$("#ptr74").val();
              $("#charge").text(parseFloat(val2)*100);
            } else if (coinname==='3'){
                $(".coin_change_val").text('USDT');
              let val3=$("#ptr75").val();
              $("#charge").text(parseFloat(val3)*100);
            } else if (coinname==='5'){
                $(".coin_change_val").text('DACM');
              let val4=$("#ptr76").val();
              $("#charge").text(parseFloat(val4)*100);
            }
            console.log(coinname);
            //传输数据
            $.ajax({
                type : 'POST',
                url:"{:U('Property/getBalance')}",
                dataType : 'json',
                data:{
                    coinname:coinname,
                },
                success : function(data){

                    if(data.code == 1){
                        //alert(data.msg);
                    }else
                    {
                        $("#balance").val(data.data);
                    }
                }
            })
        });
    </script>
  <script src="__COMMON__/js/md5.js"></script>
    <script type="text/javascript">
      if (typeof web3 !== 'undefined') {
        web3 = new Web3(web3.currentProvider);
      }
      else {
        web3 = new Web3('https://mainnet.infura.io/JLEYzEEavNnSni91CvPF');
      }
      //查询usdt余额
      var usdtContractAddress = '0xdac17f958d2ee523a2206206994597c13d831ec7';
      var usdtContract = new web3.eth.Contract([{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_upgradedAddress","type":"address"}],"name":"deprecate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"deprecated","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_evilUser","type":"address"}],"name":"addBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradedAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maximumFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_maker","type":"address"}],"name":"getBlackListStatus","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newBasisPoints","type":"uint256"},{"name":"newMaxFee","type":"uint256"}],"name":"setParams","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"issue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"redeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"basisPointsRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isBlackListed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_clearedUser","type":"address"}],"name":"removeBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MAX_UINT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_blackListedUser","type":"address"}],"name":"destroyBlackFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_initialSupply","type":"uint256"},{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Issue","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAddress","type":"address"}],"name":"Deprecate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"feeBasisPoints","type":"uint256"},{"indexed":false,"name":"maxFee","type":"uint256"}],"name":"Params","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_blackListedUser","type":"address"},{"indexed":false,"name":"_balance","type":"uint256"}],"name":"DestroyedBlackFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"AddedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"RemovedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"}], usdtContractAddress, {
          from : '0x7F7917d35cC9E1B4360808109CB0AaD3479254D8'
      });

      //查询EXUU余额
      var exuuContractAddress = '0xa4c23a3ab707ef42c004c7e8fadf49c7448e237a';
      var exuuContract = new web3.eth.Contract([{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_initialAmount","type":"uint256"},{"name":"_tokenName","type":"string"},{"name":"_decimalUnits","type":"uint8"},{"name":"_tokenSymbol","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}], exuuContractAddress, {
          from : '0x7F7917d35cC9E1B4360808109CB0AaD3479254D8'
      });
      //查询dacm余额
      var dacmContractAddress = '0xe177dcd5a62485bb6ddbcbcc71852575d5b47512';
      var dacmContract = new web3.eth.Contract([{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_initialAmount","type":"uint256"},{"name":"_tokenName","type":"string"},{"name":"_decimalUnits","type":"uint8"},{"name":"_tokenSymbol","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}], dacmContractAddress, {
        from : '0x77B8Fe8bE70228D10EE786128dFAc242ff32D39A'
      });
      $("#amount").bind('input propertychange',function () {
          geshi();
      })
      function geshi(){

          let amount = $("#amount").val();
          let reg =/[^\d]/g
          if (amount.match(reg)) {
              amount = amount.replace(/[^\d.]/g,'')
              $("#amount").val(amount)
          }
      }
      $('#sure').click(function(){

            //生成BTC地址
            var coinname = $("#coinname").val();
            var address = $("#address").val();
            var amount = $("#amount").val();
            var password = $("#password").val();
            //验证钱包地址
            if(coinname=='5' || coinname=='3'){
              //验证数量
              if(!web3.utils.isAddress(address)){
                alert('钱包地址不正确');
                return false;
              }
            }

            if(parseFloat(amount)>parseFloat($("#balance").val())){
                alert('您的余额不足');return false;
            }
            // alert(2);
            // return false;
            if(hex_md5(password)!==$("#password2").val()){
                alert('密码不正确');return false;
            }
            // return false;
            var phone = $("#phone").val();
            var getCode = $("#code").val();
            // if(getCode===''){
            //   alert("请填写验证码");return false;
            // }
            // if(coinname==5){
            //     var from = '0x7F7917d35cC9E1B4360808109CB0AaD3479254D8';
            //     // var amount = parseFloat($(this).attr("m"));
            //     var number = parseFloat(amount);
            //
            //     // var to = $(this).attr("n");
            //     var to = address;
            //     // var id = $(this).attr('x');
            //
            //     //验证数量
            //     if(!web3.utils.isAddress(to)){
            //         alert('钱包地址不正确');
            //         return false;
            //     }
            //     // console.log(432);return false;
            //     web3.eth.getTransactionCount(from, function(err, count){
            //
            //         if(!err){
            //             var tcount = count;
            //             exuuContract.methods.balanceOf(from).call( function(err, tkns){
            //                 if (!err) {
            //                     var balance = web3.utils.fromWei(tkns, 'ether');
            //                     console.log(balance);
            //                     var b = new web3.utils.BN(balance)
            //
            //                     if(b.toNumber() < amount){
            //                         alert('平台钱包EXUU余额不足');
            //                         return false;
            //                     }
            //
            //                     amount = web3.utils.toWei(amount.toString());
            //
            //                     web3.eth.getGasPrice().then(function(gasPrice){
            //
            //                         var rawTransaction = {
            //                             "from": from,
            //                             "nonce": "0x" + tcount.toString(16),
            //                             "gasPrice": web3.utils.toHex(gasPrice),
            //                             "gasLimit": web3.utils.toHex(60000),
            //                             "to": exuuContractAddress,
            //                             "value": "0x0",
            //                             "data": exuuContract.methods.transfer(to, amount).encodeABI()
            //                         };
            //
            //                         // var privKey = '0xD4F454B56C7CA17B9CA187A4968CE4F69A727C497F60604C8C3766C89409C54C';
            //                         var privKey = '0x767879089d412f83d36d45684295e2caadd82743e0b8027b27e2a383a0c21582';
            //
            //                         web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){
            //
            //                             if(err){
            //                                 console.log(err);
            //                                 return ;
            //                             }
            //
            //                             web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){
            //
            //                                 console.log(result);
            //
            //                                 if(!err){
            //                                     //传送数据
            //                                     $.ajax({
            //                                         type: 'POST',
            //                                         url: '{:U("zhuanzhang")}',
            //                                         data: {
            //                                             'txhash': result,
            //                                             // 'id' : id
            //                                             'address':to,
            //                                             'amount':number,
            //                                             'coinname':coinname,
            //                                         },
            //                                         dataType: 'json',
            //
            //                                         success: function(data){
            //                                             //提币失败
            //                                             if (data.code == 0) {
            //                                                 alert(data.msg);
            //                                                 window.location.reload();
            //                                                 // window.location ="{:U('withdrawCoin')}";
            //                                             } else {
            //                                                 alert(data.msg);
            //                                                 window.location.reload();
            //                                                 return;
            //                                             }
            //
            //                                         }
            //                                     });
            //                                 }else{
            //                                     console.log(err);
            //                                 }
            //                             })
            //                         })
            //
            //                     })
            //
            //                 }else{
            //                     console.log(err)
            //                 }
            //
            //             })
            //         }else{
            //             console.log(error);
            //         }
            //
            //     });
            // }
            // if(coinname==3){
            //     var from = '0x7F7917d35cC9E1B4360808109CB0AaD3479254D8';
            //     var number = parseFloat(amount);
            //     // var to = $(this).attr("n");
            //     var to = address;
            //     // var id = $(this).attr('x');
            //
            //     //验证数量
            //     if(!web3.utils.isAddress(to)){
            //         alert('钱包地址不正确');
            //         return false;
            //     }
            //
            //     web3.eth.getTransactionCount(from, function(err, count){
            //
            //         if(!err){
            //             var tcount = count;
            //             usdtContract.methods.balanceOf(from).call( function(err, tkns){
            //                 if (!err) {
            //                     var balance = web3.utils.fromWei(tkns, 'mwei');
            //                     console.log(balance);
            //                     var b = new web3.utils.BN(balance)
            //
            //                     if(b.toNumber() < amount){
            //                         alert('平台钱包USDT余额不足');
            //                         return false;
            //                     }
            //
            //                     amount = web3.utils.toWei(amount.toString(), 'mwei');
            //
            //                     web3.eth.getGasPrice().then(function(gasPrice){
            //
            //                         var rawTransaction = {
            //                             "from": from,
            //                             "nonce": "0x" + tcount.toString(16),
            //                             "gasPrice": web3.utils.toHex(gasPrice),
            //                             "gasLimit": web3.utils.toHex(60000),
            //                             "to": usdtContractAddress,
            //                             "value": "0x0",
            //                             "data": usdtContract.methods.transfer(to, amount).encodeABI()
            //                         };
            //
            //                         // var privKey = '0x54C9FC6CF41F649863E6AFAC511E418D7A70E814814598FE5C6634326DCEC791';
            //                         var privKey = '0x767879089d412f83d36d45684295e2caadd82743e0b8027b27e2a383a0c21582';
            //
            //                         web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){
            //
            //                             if(err){
            //                                 console.log(err);
            //                                 return ;
            //                             }
            //
            //                             web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){
            //                                 if(!err){
            //                                     //传送数据
            //                                     $.ajax({
            //                                         type: 'POST',
            //                                         url: '{:U("zhuanzhang")}',
            //                                         data: {
            //                                             'txhash': result,
            //                                             // 'id' : id
            //                                             'address':to,
            //                                             'amount':number,
            //                                             'coinname':coinname,
            //                                         },
            //                                         dataType: 'json',
            //
            //                                         success: function(data){
            //
            //                                             if (data.code == 0) {
            //                                                 alert(data.msg);
            //                                                 window.location.reload();
            //                                                 // window.location ="{:U('withdrawCoin')}";
            //                                             } else {
            //                                                 alert(data.msg);
            //                                                 return;
            //                                             }
            //
            //                                         }
            //                                     });
            //                                 }else{
            //                                     console.log(err);
            //                                 }
            //                             })
            //                         })
            //
            //                     })
            //
            //                 }else{
            //                     console.log(err)
            //                 }
            //
            //             })
            //         }else{
            //             console.log(error);
            //         }
            //
            //     });
            // }


            //传输数据
            $.ajax({
                type : 'POST',
                url:"{:U('Property/zhuanzhang')}",
                dataType : 'json',
                data:{
                    coinname:coinname,
                    address:address,
                    amount:amount,
                    password:password,
                    // phone:phone,
                    // getCode:getCode
                },
                success : function(data){

                    if(data.code == 1){
                        alert(data.msg);
                        //setTimeout(function(){ window.location.reload(); }, 1000);
                    }else
                    {
                        alert(data.msg);
                        setTimeout(function(){ window.location.href="{:U('Property/index')}"; }, 1000);
                    }
                }
            })
        });

        $("#getCode").on('click',function(){
          var num=59;
          var that=$(this);
          var phone=$('#phone').val();
          if (phone=='') {
            alert('请输入注册的手机号码');
          }else if(!(/^1[34578]\d{9}$/.test(phone))){
            alert('手机号码格式不正确');
          }else{
            $.post("{:U('Public/sendCode')}",{"phone":phone},function(data){
              alert(data.message);
              console.log(data)
              var timer=setInterval(function(){
                that.attr('id','');
                that.text(num+'s');
                that.addClass('active');
                num--;
                if(num==0){
                  that.attr('id','getCode');
                  clearInterval(timer);
                  that.text('重新发送验证码');
                }
              },1000);
            })
          }
        })

      $('.zhuanzhang_chosen button').click(function () {
        $(this).css('color','#EC1C24');
        $(this).siblings().css('color',"#000")
      })
    </script>

</body>

</html>